#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <xgraphicsview.h>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QGraphicsScene *scene = new QGraphicsScene(this);
    QRectF rc = QRectF(0 , 0 , 400, 300);
    scene->setSceneRect(rc);
    ui->graphicsView->setScene(scene);
    ui->graphicsView->setRenderHint(QPainter::Antialiasing);
    ui->graphicsView->setCacheMode(QGraphicsView::CacheBackground);
    ui->graphicsView->setOptimizationFlags(QGraphicsView::DontSavePainterState);
    ui->graphicsView->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
    ui->graphicsView->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
    ui->graphicsView->setTransform( ui->graphicsView->transform().scale(1,-1));
    //scene->setBackgroundBrush(Qt::darkGray);
    ui->graphicsView->setRuleBarVisible(true);

}

MainWindow::~MainWindow()
{
    delete ui;
}

